use x86_64::registers::control::{Cr0, Cr0Flags, Cr4, Cr4Flags};

pub fn init() {
    let mut cr0 = Cr0::read();
    cr0.set(Cr0Flags::EMULATE_COPROCESSOR, false);
    cr0.set(Cr0Flags::MONITOR_COPROCESSOR, true);
    unsafe { Cr0::write(cr0) };

    let mut cr4 = Cr4::read();
    cr4.set(Cr4Flags::OSFXSR, true);
    cr4.set(Cr4Flags::OSXMMEXCPT_ENABLE, true);
    unsafe { Cr4::write(cr4) };
}
